package com.itheima.controller;

import com.itheima.common.entity.Result;
import com.itheima.service.ValidatecodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/validatecode")
@Api(tags = "短信相关")
public class ValidatecodeController {

    @Autowired
    private ValidatecodeService validatecodeService;


    @PostMapping("/send4Order")
    @ApiOperation("发送短信")
    public Result send (@RequestParam String telephone) {
        validatecodeService.send(telephone);
        return Result.success();
    }
}
